Optimal. Leaf size=252 \[ \frac {\left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \tan (c+d x)}{30 b d}+\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.32, antiderivative size = 252, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {4095, 4087,
4082, 3872, 3855, 3852, 8} \begin {gather*} \frac {\left (-3 a^2 B+15 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{60 b d}+\frac {\left (4 a^3 B+12 a^2 A b+9 a b^2 B+3 A b^3\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (-6 a^3 B+30 a^2 A b+71 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{120 d}+\frac {\left (-3 a^4 B+15 a^3 A b+52 a^2 b^2 B+60 a A b^3+16 b^4 B\right ) \tan (c+d x)}{30 b d}+\frac {(5 A b-a B) \tan (c+d x) (a+b \sec (c+d x))^3}{20 b d}+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3872
Rule 4082
Rule 4087
Rule 4095
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx &=\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) (a+b \sec (c+d x))^3 (4 b B+(5 A b-a B) \sec (c+d x)) \, dx}{5 b}\\ &=\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) (a+b \sec (c+d x))^2 \left (b (15 A b+13 a B)+\left (15 a A b-3 a^2 B+16 b^2 B\right ) \sec (c+d x)\right ) \, dx}{20 b}\\ &=\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) (a+b \sec (c+d x)) \left (b \left (75 a A b+33 a^2 B+32 b^2 B\right )+\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x)\right ) \, dx}{60 b}\\ &=\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) \left (15 b \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right )+4 \left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \sec (c+d x)\right ) \, dx}{120 b}\\ &=\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {1}{8} \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \int \sec (c+d x) \, dx+\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \int \sec ^2(c+d x) \, dx}{30 b}\\ &=\frac {\left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}-\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{30 b d}\\ &=\frac {\left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \tan (c+d x)}{30 b d}+\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 3.47, size = 181, normalized size = 0.72 \begin {gather*} \frac {15 \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (15 \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \sec (c+d x)+30 b^2 (A b+3 a B) \sec ^3(c+d x)+8 \left (15 \left (a^3 A+3 a A b^2+3 a^2 b B+b^3 B\right )+5 b \left (3 a A b+3 a^2 B+2 b^2 B\right ) \tan ^2(c+d x)+3 b^3 B \tan ^4(c+d x)\right )\right )}{120 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.53, size = 275, normalized size = 1.09 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 341, normalized size = 1.35 \begin {gather*} \frac {240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} b + 240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a b^{2} + 16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} B b^{3} - 45 \, B a b^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 15 \, A b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, B a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 180 \, A a^{2} b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 240 \, A a^{3} \tan \left (d x + c\right )}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.45, size = 249, normalized size = 0.99 \begin {gather*} \frac {15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (15 \, A a^{3} + 30 \, B a^{2} b + 30 \, A a b^{2} + 8 \, B b^{3}\right )} \cos \left (d x + c\right )^{4} + 24 \, B b^{3} + 15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )^{3} + 8 \, {\left (15 \, B a^{2} b + 15 \, A a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{3} \sec ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 722 vs.
\(2 (239) = 478\).
time = 0.51, size = 722, normalized size = 2.87 \begin {gather*} \frac {15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (120 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 60 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 180 \, A a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 360 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 360 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 225 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 75 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 120 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 480 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 120 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 360 \, A a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 960 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 960 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 90 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 30 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 160 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 720 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 1200 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 1200 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 464 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 480 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 360 \, A a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 960 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 960 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 90 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 30 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 160 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 60 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 180 \, A a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 360 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 360 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 225 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 75 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.79, size = 470, normalized size = 1.87 \begin {gather*} \frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {B\,a^3}{2}+\frac {3\,A\,a^2\,b}{2}+\frac {9\,B\,a\,b^2}{8}+\frac {3\,A\,b^3}{8}\right )}{2\,B\,a^3+6\,A\,a^2\,b+\frac {9\,B\,a\,b^2}{2}+\frac {3\,A\,b^3}{2}}\right )\,\left (B\,a^3+3\,A\,a^2\,b+\frac {9\,B\,a\,b^2}{4}+\frac {3\,A\,b^3}{4}\right )}{d}-\frac {\left (2\,A\,a^3-\frac {5\,A\,b^3}{4}-B\,a^3+2\,B\,b^3+6\,A\,a\,b^2-3\,A\,a^2\,b-\frac {15\,B\,a\,b^2}{4}+6\,B\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {A\,b^3}{2}-8\,A\,a^3+2\,B\,a^3-\frac {8\,B\,b^3}{3}-16\,A\,a\,b^2+6\,A\,a^2\,b+\frac {3\,B\,a\,b^2}{2}-16\,B\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (12\,A\,a^3+20\,B\,a^2\,b+20\,A\,a\,b^2+\frac {116\,B\,b^3}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-8\,A\,a^3-\frac {A\,b^3}{2}-2\,B\,a^3-\frac {8\,B\,b^3}{3}-16\,A\,a\,b^2-6\,A\,a^2\,b-\frac {3\,B\,a\,b^2}{2}-16\,B\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,A\,a^3+\frac {5\,A\,b^3}{4}+B\,a^3+2\,B\,b^3+6\,A\,a\,b^2+3\,A\,a^2\,b+\frac {15\,B\,a\,b^2}{4}+6\,B\,a^2\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________